{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 自动求导这节是需要有一定的基础才能理解的，建议先去学习计算图，充分理解计算图后，然后结合计算图来看本节内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0., 1., 2., 3.])"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import torch\n",
    "x = torch.arange(4.0)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "x.requires_grad_(True)\n",
    "x.grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor(28., grad_fn=<MulBackward0>)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = 2 * torch.dot(x, x)\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([ 0.,  4.,  8., 12.])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.backward()\n",
    "x.grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([True, True, True, True])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.grad == 4 * x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([1., 1., 1., 1.])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.grad.zero_()\n",
    "y = x.sum()\n",
    "y.backward()\n",
    "x.grad\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0., 2., 4., 6.])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.grad.zero_()\n",
    "y = x * x\n",
    "y.sum().backward()  # 等同于y.backward(torch.ones(len(x)))\n",
    "x.grad"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "怎么理解上面的y.sum()呢？\n",
    "解释如下，x为一个向量，前面讲过向量*向量为哈达玛积，结果为含len(x)个元素的向量，则反向传播就为一个矩阵，此处看下面。y.sum()降低了轴维度，从而可求出梯度。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=4>$\\textbf{X}=\\begin{bmatrix}x_{1} & x_{2}& x_{3}& x_{4} \\end{bmatrix} $ <br/> $\\textbf{Y}=\\textbf{X}*\\textbf{X}=\n",
    " \\begin{bmatrix}\n",
    " x_{1}^{2}\\\\ \n",
    " x_{2}^{2}\\\\ \n",
    " x_{3}^{2}\\\\ \n",
    " x_{4}^{2}\n",
    "\\end{bmatrix}$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=4>$\\textbf{D}(\\frac{\\textbf{Y}}{x_{1}})=\n",
    " \\begin{bmatrix}\n",
    " 2x_{1}\\\\ \n",
    " 0\\\\ \n",
    " 0\\\\ \n",
    " 0\n",
    "\\end{bmatrix}$\n",
    "$ \\textbf{D}(\\frac{\\textbf{Y}}{x_{2}})=\n",
    " \\begin{bmatrix}\n",
    " 0\\\\ \n",
    " 2x_{2}\\\\ \n",
    " 0\\\\ \n",
    " 0\n",
    "\\end{bmatrix}  \\textbf{D}(\\frac{\\textbf{Y}}{x_{3}})=\n",
    " \\begin{bmatrix}\n",
    " 0\\\\ \n",
    " 0\\\\ \n",
    " 2x_{3}\\\\ \n",
    " 0\n",
    "\\end{bmatrix}   \\textbf{D}(\\frac{\\textbf{Y}}{x_{4}})=\n",
    " \\begin{bmatrix}\n",
    " 0\\\\ \n",
    " 0\\\\ \n",
    " 0\\\\ \n",
    "2x_{4}\n",
    "\\end{bmatrix}    $  \n",
    "合并后即为4*4的矩阵  \n",
    "   $ \\textbf{D}(\\frac{\\textbf{Y}}{\\textbf{X}})=\\begin{bmatrix}\n",
    "2x_{1} & 0 & 0 & 0\\\\ \n",
    "0 & 2x_{2} & 0 & 0\\\\ \n",
    "0 & 0 & 2x_{3} & 0\\\\ \n",
    "0 & 0 & 0 & 2x_{4}\n",
    "\\end{bmatrix} $\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<MulBackward0 at 0x21ca02263a0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.grad_fn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0., 2., 4., 6.])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.grad"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "阻止计算图的追踪回溯有两种办法，一个是使用 `with torch.no_grad()`阻止计算图记录，另外一个是使用`.detach`生成一个数值相同但不可微的相同张量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([True, True, True, True])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.grad.zero_()\n",
    "y = x * x\n",
    "# .detach()方法：创建一个不可导的相同张量\n",
    "u = y.detach()\n",
    "z = u * x\n",
    "\n",
    "z.sum().backward()\n",
    "x.grad == u  #请注意，这里的u是一个常量，此时不是z = x * x * x  ，而是 z = u * x,u=[0, 1, 4, 9]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这里可以理解为整个过程为两个计算图，一个是$y=x^{2}$，另外一个可以理解为$z = u * x =[0, 1, 4, 9]*x$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "因此，上述记录了y的计算结果，可以调用y的反向传播来计算 $y = x * x$关于x的倒数，这里是$2*x$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([True, True, True, True])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.grad.zero_()\n",
    "y.sum().backward()\n",
    "x.grad == 2 * x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "判断叶节点， 用is_leaf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(True, False)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.is_leaf, y.is_leaf"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font color=red>注意</font>：`is_leaf`有容易混淆的地方，即对任意一个新创建的张量都可以是叶节点，<font color=red>无论是否可导，是否加入计算图</font> 这些节点距离真正的叶节点，只差一个`requires_grad`属性调整。什么意思呢？is_leaf返回的包含可能成为叶节点和叶节点的判断，比如u如果后面加上`u.requires_grad_(True)`,也可以作为叶节点，此时u和z构成新的计算图，并作为z的叶节点。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0., 1., 4., 9.], requires_grad=True)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u.requires_grad_(True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([ 0.,  1.,  8., 27.], grad_fn=<MulBackward0>)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "z"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u.is_leaf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "ename": "RuntimeError",
     "evalue": "grad can be implicitly created only for scalar outputs",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-16-7c5391a3c07e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mu\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbackward\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mD:\\ProgramData\\Anaconda3\\lib\\site-packages\\torch\\tensor.py\u001b[0m in \u001b[0;36mbackward\u001b[1;34m(self, gradient, retain_graph, create_graph, inputs)\u001b[0m\n\u001b[0;32m    243\u001b[0m                 \u001b[0mcreate_graph\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcreate_graph\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    244\u001b[0m                 inputs=inputs)\n\u001b[1;32m--> 245\u001b[1;33m         \u001b[0mtorch\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mautograd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbackward\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgradient\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mretain_graph\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcreate_graph\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minputs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minputs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    246\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    247\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mregister_hook\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mhook\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\ProgramData\\Anaconda3\\lib\\site-packages\\torch\\autograd\\__init__.py\u001b[0m in \u001b[0;36mbackward\u001b[1;34m(tensors, grad_tensors, retain_graph, create_graph, grad_variables, inputs)\u001b[0m\n\u001b[0;32m    139\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    140\u001b[0m     \u001b[0mgrad_tensors_\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0m_tensor_or_tensors_to_tuple\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mgrad_tensors\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtensors\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 141\u001b[1;33m     \u001b[0mgrad_tensors_\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0m_make_grads\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtensors\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgrad_tensors_\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    142\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0mretain_graph\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    143\u001b[0m         \u001b[0mretain_graph\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcreate_graph\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\ProgramData\\Anaconda3\\lib\\site-packages\\torch\\autograd\\__init__.py\u001b[0m in \u001b[0;36m_make_grads\u001b[1;34m(outputs, grads)\u001b[0m\n\u001b[0;32m     48\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mout\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrequires_grad\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     49\u001b[0m                 \u001b[1;32mif\u001b[0m \u001b[0mout\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnumel\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 50\u001b[1;33m                     \u001b[1;32mraise\u001b[0m \u001b[0mRuntimeError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"grad can be implicitly created only for scalar outputs\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     51\u001b[0m                 \u001b[0mnew_grads\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mones_like\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mout\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmemory_format\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mtorch\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpreserve_format\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     52\u001b[0m             \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mRuntimeError\u001b[0m: grad can be implicitly created only for scalar outputs"
     ]
    }
   ],
   "source": [
    "u.backward()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f(a):\n",
    "    b = a * 2\n",
    "    while b.norm() < 1000:\n",
    "        b = b * 2\n",
    "    if b.sum() > 0:\n",
    "        c = b\n",
    "    else:\n",
    "        c = b * 100\n",
    "    return c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor(True)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = torch.randn(size=(), requires_grad=True)\n",
    "d = f(a)\n",
    "d.backward()\n",
    "a.grad == d / a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "注，这里的  \n",
    "`if b.sum() > 0:\n",
    "   c = b\n",
    " else:\n",
    "   c = b * 100`  \n",
    "   去掉也不影响结果，意思是$c=k*a\\left\\{\\begin{matrix}\n",
    "k=2^{n}&a\\geqslant 0\\\\ \n",
    "k=100\\cdot 2^{n}& a< 0\n",
    "\\end{matrix}\\right.$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 练习"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.为什么计算二阶导数比一阶导数的开销要更大？"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答：二阶导数是在一阶导数的基础上进行求导，可以理解为链式法则"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.重新设计一个求控制流梯度的例子。运行并分析结果。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "from math import sin,exp\n",
    "def k(x):\n",
    "    a = x**2*sin(x)+exp(x)\n",
    "    for i in range(6):\n",
    "        if a.norm() < 3:\n",
    "            c = a * i\n",
    "        else:\n",
    "            c = a - i\n",
    "    return c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor(2.1132)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a1 = torch.randn(size=(), requires_grad=True)\n",
    "d1 = k(a1)\n",
    "d1.backward()\n",
    "a1.grad"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "第五题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n",
       "<svg height=\"180.65625pt\" version=\"1.1\" viewBox=\"0 0 258.046508 180.65625\" width=\"258.046508pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       " <metadata>\r\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n",
       "   <cc:Work>\r\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n",
       "    <dc:date>2021-06-25T14:41:04.976826</dc:date>\r\n",
       "    <dc:format>image/svg+xml</dc:format>\r\n",
       "    <dc:creator>\r\n",
       "     <cc:Agent>\r\n",
       "      <dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>\r\n",
       "     </cc:Agent>\r\n",
       "    </dc:creator>\r\n",
       "   </cc:Work>\r\n",
       "  </rdf:RDF>\r\n",
       " </metadata>\r\n",
       " <defs>\r\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n",
       " </defs>\r\n",
       " <g id=\"figure_1\">\r\n",
       "  <g id=\"patch_1\">\r\n",
       "   <path d=\"M 0 180.65625 \r\n",
       "L 258.046508 180.65625 \r\n",
       "L 258.046508 0 \r\n",
       "L 0 0 \r\n",
       "z\r\n",
       "\" style=\"fill:none;\"/>\r\n",
       "  </g>\r\n",
       "  <g id=\"axes_1\">\r\n",
       "   <g id=\"patch_2\">\r\n",
       "    <path d=\"M 52.160938 143.1 \r\n",
       "L 247.460938 143.1 \r\n",
       "L 247.460938 7.2 \r\n",
       "L 52.160938 7.2 \r\n",
       "z\r\n",
       "\" style=\"fill:#ffffff;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"matplotlib.axis_1\">\r\n",
       "    <g id=\"xtick_1\">\r\n",
       "     <g id=\"line2d_1\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 55.605867 143.1 \r\n",
       "L 55.605867 7.2 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_2\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 0 0 \r\n",
       "L 0 3.5 \r\n",
       "\" id=\"m2c732053c1\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n",
       "      </defs>\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"55.605867\" xlink:href=\"#m2c732053c1\" y=\"143.1\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_1\">\r\n",
       "      <!-- −10 -->\r\n",
       "      <g transform=\"translate(45.053523 157.698438)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 10.59375 35.5 \r\n",
       "L 73.1875 35.5 \r\n",
       "L 73.1875 27.203125 \r\n",
       "L 10.59375 27.203125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-8722\"/>\r\n",
       "        <path d=\"M 12.40625 8.296875 \r\n",
       "L 28.515625 8.296875 \r\n",
       "L 28.515625 63.921875 \r\n",
       "L 10.984375 60.40625 \r\n",
       "L 10.984375 69.390625 \r\n",
       "L 28.421875 72.90625 \r\n",
       "L 38.28125 72.90625 \r\n",
       "L 38.28125 8.296875 \r\n",
       "L 54.390625 8.296875 \r\n",
       "L 54.390625 0 \r\n",
       "L 12.40625 0 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-49\"/>\r\n",
       "        <path d=\"M 31.78125 66.40625 \r\n",
       "Q 24.171875 66.40625 20.328125 58.90625 \r\n",
       "Q 16.5 51.421875 16.5 36.375 \r\n",
       "Q 16.5 21.390625 20.328125 13.890625 \r\n",
       "Q 24.171875 6.390625 31.78125 6.390625 \r\n",
       "Q 39.453125 6.390625 43.28125 13.890625 \r\n",
       "Q 47.125 21.390625 47.125 36.375 \r\n",
       "Q 47.125 51.421875 43.28125 58.90625 \r\n",
       "Q 39.453125 66.40625 31.78125 66.40625 \r\n",
       "z\r\n",
       "M 31.78125 74.21875 \r\n",
       "Q 44.046875 74.21875 50.515625 64.515625 \r\n",
       "Q 56.984375 54.828125 56.984375 36.375 \r\n",
       "Q 56.984375 17.96875 50.515625 8.265625 \r\n",
       "Q 44.046875 -1.421875 31.78125 -1.421875 \r\n",
       "Q 19.53125 -1.421875 13.0625 8.265625 \r\n",
       "Q 6.59375 17.96875 6.59375 36.375 \r\n",
       "Q 6.59375 54.828125 13.0625 64.515625 \r\n",
       "Q 19.53125 74.21875 31.78125 74.21875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-48\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_2\">\r\n",
       "     <g id=\"line2d_3\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 102.825402 143.1 \r\n",
       "L 102.825402 7.2 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_4\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"102.825402\" xlink:href=\"#m2c732053c1\" y=\"143.1\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_2\">\r\n",
       "      <!-- −5 -->\r\n",
       "      <g transform=\"translate(95.454309 157.698438)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 10.796875 72.90625 \r\n",
       "L 49.515625 72.90625 \r\n",
       "L 49.515625 64.59375 \r\n",
       "L 19.828125 64.59375 \r\n",
       "L 19.828125 46.734375 \r\n",
       "Q 21.96875 47.46875 24.109375 47.828125 \r\n",
       "Q 26.265625 48.1875 28.421875 48.1875 \r\n",
       "Q 40.625 48.1875 47.75 41.5 \r\n",
       "Q 54.890625 34.8125 54.890625 23.390625 \r\n",
       "Q 54.890625 11.625 47.5625 5.09375 \r\n",
       "Q 40.234375 -1.421875 26.90625 -1.421875 \r\n",
       "Q 22.3125 -1.421875 17.546875 -0.640625 \r\n",
       "Q 12.796875 0.140625 7.71875 1.703125 \r\n",
       "L 7.71875 11.625 \r\n",
       "Q 12.109375 9.234375 16.796875 8.0625 \r\n",
       "Q 21.484375 6.890625 26.703125 6.890625 \r\n",
       "Q 35.15625 6.890625 40.078125 11.328125 \r\n",
       "Q 45.015625 15.765625 45.015625 23.390625 \r\n",
       "Q 45.015625 31 40.078125 35.4375 \r\n",
       "Q 35.15625 39.890625 26.703125 39.890625 \r\n",
       "Q 22.75 39.890625 18.8125 39.015625 \r\n",
       "Q 14.890625 38.140625 10.796875 36.28125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-53\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_3\">\r\n",
       "     <g id=\"line2d_5\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 150.044938 143.1 \r\n",
       "L 150.044938 7.2 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_6\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"150.044938\" xlink:href=\"#m2c732053c1\" y=\"143.1\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_3\">\r\n",
       "      <!-- 0 -->\r\n",
       "      <g transform=\"translate(146.863688 157.698438)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_4\">\r\n",
       "     <g id=\"line2d_7\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 197.264473 143.1 \r\n",
       "L 197.264473 7.2 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_8\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"197.264473\" xlink:href=\"#m2c732053c1\" y=\"143.1\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_4\">\r\n",
       "      <!-- 5 -->\r\n",
       "      <g transform=\"translate(194.083223 157.698438)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_5\">\r\n",
       "     <g id=\"line2d_9\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 244.484008 143.1 \r\n",
       "L 244.484008 7.2 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_10\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"244.484008\" xlink:href=\"#m2c732053c1\" y=\"143.1\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_5\">\r\n",
       "      <!-- 10 -->\r\n",
       "      <g transform=\"translate(238.121508 157.698438)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"text_6\">\r\n",
       "     <!-- x -->\r\n",
       "     <g transform=\"translate(146.851563 171.376563)scale(0.1 -0.1)\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 54.890625 54.6875 \r\n",
       "L 35.109375 28.078125 \r\n",
       "L 55.90625 0 \r\n",
       "L 45.3125 0 \r\n",
       "L 29.390625 21.484375 \r\n",
       "L 13.484375 0 \r\n",
       "L 2.875 0 \r\n",
       "L 24.125 28.609375 \r\n",
       "L 4.6875 54.6875 \r\n",
       "L 15.28125 54.6875 \r\n",
       "L 29.78125 35.203125 \r\n",
       "L 44.28125 54.6875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-120\"/>\r\n",
       "      </defs>\r\n",
       "      <use xlink:href=\"#DejaVuSans-120\"/>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "   </g>\r\n",
       "   <g id=\"matplotlib.axis_2\">\r\n",
       "    <g id=\"ytick_1\">\r\n",
       "     <g id=\"line2d_11\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 52.160938 136.922727 \r\n",
       "L 247.460938 136.922727 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_12\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 0 0 \r\n",
       "L -3.5 0 \r\n",
       "\" id=\"mfb5a1ca73c\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n",
       "      </defs>\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"52.160938\" xlink:href=\"#mfb5a1ca73c\" y=\"136.922727\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_7\">\r\n",
       "      <!-- −1.0 -->\r\n",
       "      <g transform=\"translate(20.878125 140.721946)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 10.6875 12.40625 \r\n",
       "L 21 12.40625 \r\n",
       "L 21 0 \r\n",
       "L 10.6875 0 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-46\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_2\">\r\n",
       "     <g id=\"line2d_13\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 52.160938 106.036213 \r\n",
       "L 247.460938 106.036213 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_14\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"52.160938\" xlink:href=\"#mfb5a1ca73c\" y=\"106.036213\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_8\">\r\n",
       "      <!-- −0.5 -->\r\n",
       "      <g transform=\"translate(20.878125 109.835431)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_3\">\r\n",
       "     <g id=\"line2d_15\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 52.160938 75.149698 \r\n",
       "L 247.460938 75.149698 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_16\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"52.160938\" xlink:href=\"#mfb5a1ca73c\" y=\"75.149698\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_9\">\r\n",
       "      <!-- 0.0 -->\r\n",
       "      <g transform=\"translate(29.257812 78.948917)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_4\">\r\n",
       "     <g id=\"line2d_17\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 52.160938 44.263183 \r\n",
       "L 247.460938 44.263183 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_18\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"52.160938\" xlink:href=\"#mfb5a1ca73c\" y=\"44.263183\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_10\">\r\n",
       "      <!-- 0.5 -->\r\n",
       "      <g transform=\"translate(29.257812 48.062402)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_5\">\r\n",
       "     <g id=\"line2d_19\">\r\n",
       "      <path clip-path=\"url(#pb28d4a707e)\" d=\"M 52.160938 13.376669 \r\n",
       "L 247.460938 13.376669 \r\n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n",
       "     </g>\r\n",
       "     <g id=\"line2d_20\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"52.160938\" xlink:href=\"#mfb5a1ca73c\" y=\"13.376669\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_11\">\r\n",
       "      <!-- 1.0 -->\r\n",
       "      <g transform=\"translate(29.257812 17.175888)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"text_12\">\r\n",
       "     <!-- f(x) -->\r\n",
       "     <g transform=\"translate(14.798438 83.771094)rotate(-90)scale(0.1 -0.1)\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 37.109375 75.984375 \r\n",
       "L 37.109375 68.5 \r\n",
       "L 28.515625 68.5 \r\n",
       "Q 23.6875 68.5 21.796875 66.546875 \r\n",
       "Q 19.921875 64.59375 19.921875 59.515625 \r\n",
       "L 19.921875 54.6875 \r\n",
       "L 34.71875 54.6875 \r\n",
       "L 34.71875 47.703125 \r\n",
       "L 19.921875 47.703125 \r\n",
       "L 19.921875 0 \r\n",
       "L 10.890625 0 \r\n",
       "L 10.890625 47.703125 \r\n",
       "L 2.296875 47.703125 \r\n",
       "L 2.296875 54.6875 \r\n",
       "L 10.890625 54.6875 \r\n",
       "L 10.890625 58.5 \r\n",
       "Q 10.890625 67.625 15.140625 71.796875 \r\n",
       "Q 19.390625 75.984375 28.609375 75.984375 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-102\"/>\r\n",
       "       <path d=\"M 31 75.875 \r\n",
       "Q 24.46875 64.65625 21.28125 53.65625 \r\n",
       "Q 18.109375 42.671875 18.109375 31.390625 \r\n",
       "Q 18.109375 20.125 21.3125 9.0625 \r\n",
       "Q 24.515625 -2 31 -13.1875 \r\n",
       "L 23.1875 -13.1875 \r\n",
       "Q 15.875 -1.703125 12.234375 9.375 \r\n",
       "Q 8.59375 20.453125 8.59375 31.390625 \r\n",
       "Q 8.59375 42.28125 12.203125 53.3125 \r\n",
       "Q 15.828125 64.359375 23.1875 75.875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-40\"/>\r\n",
       "       <path d=\"M 8.015625 75.875 \r\n",
       "L 15.828125 75.875 \r\n",
       "Q 23.140625 64.359375 26.78125 53.3125 \r\n",
       "Q 30.421875 42.28125 30.421875 31.390625 \r\n",
       "Q 30.421875 20.453125 26.78125 9.375 \r\n",
       "Q 23.140625 -1.703125 15.828125 -13.1875 \r\n",
       "L 8.015625 -13.1875 \r\n",
       "Q 14.5 -2 17.703125 9.0625 \r\n",
       "Q 20.90625 20.125 20.90625 31.390625 \r\n",
       "Q 20.90625 42.671875 17.703125 53.65625 \r\n",
       "Q 14.5 64.65625 8.015625 75.875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-41\"/>\r\n",
       "      </defs>\r\n",
       "      <use xlink:href=\"#DejaVuSans-102\"/>\r\n",
       "      <use x=\"35.205078\" xlink:href=\"#DejaVuSans-40\"/>\r\n",
       "      <use x=\"74.21875\" xlink:href=\"#DejaVuSans-120\"/>\r\n",
       "      <use x=\"133.398438\" xlink:href=\"#DejaVuSans-41\"/>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "   </g>\r\n",
       "   <g id=\"line2d_21\">\r\n",
       "    <path clip-path=\"url(#pb28d4a707e)\" d=\"M 61.03821 75.149697 \r\n",
       "L 64.815769 99.205226 \r\n",
       "L 66.704558 110.029393 \r\n",
       "L 68.593338 119.462964 \r\n",
       "L 70.482117 127.129908 \r\n",
       "L 71.426512 130.202286 \r\n",
       "L 72.370897 132.724572 \r\n",
       "L 73.315291 134.67161 \r\n",
       "L 74.259686 136.02392 \r\n",
       "L 75.204071 136.767986 \r\n",
       "L 76.148461 136.896387 \r\n",
       "L 77.09285 136.407838 \r\n",
       "L 78.03724 135.30722 \r\n",
       "L 78.981635 133.605521 \r\n",
       "L 79.926024 131.319757 \r\n",
       "L 80.870414 128.472759 \r\n",
       "L 81.814804 125.092978 \r\n",
       "L 83.703588 116.875102 \r\n",
       "L 85.592368 106.993787 \r\n",
       "L 87.481152 95.842921 \r\n",
       "L 91.258711 71.543764 \r\n",
       "L 94.091885 53.480757 \r\n",
       "L 95.980665 42.420127 \r\n",
       "L 97.869444 32.664319 \r\n",
       "L 99.758228 24.602245 \r\n",
       "L 100.702618 21.30983 \r\n",
       "L 101.647012 18.555349 \r\n",
       "L 102.591402 16.366354 \r\n",
       "L 103.535792 14.764701 \r\n",
       "L 104.480182 13.766397 \r\n",
       "L 105.424572 13.381411 \r\n",
       "L 106.368966 13.613596 \r\n",
       "L 107.313356 14.460623 \r\n",
       "L 108.257746 15.91404 \r\n",
       "L 109.20214 17.959328 \r\n",
       "L 110.14653 20.576037 \r\n",
       "L 111.090919 23.738023 \r\n",
       "L 112.035309 27.413697 \r\n",
       "L 113.924091 36.154452 \r\n",
       "L 115.812873 46.449824 \r\n",
       "L 118.646045 63.896975 \r\n",
       "L 124.312388 100.158506 \r\n",
       "L 126.20117 110.881679 \r\n",
       "L 128.089952 120.180327 \r\n",
       "L 129.034342 124.176966 \r\n",
       "L 129.978731 127.683741 \r\n",
       "L 130.923123 130.66562 \r\n",
       "L 131.867513 133.092797 \r\n",
       "L 132.811904 134.941027 \r\n",
       "L 133.756295 136.191844 \r\n",
       "L 134.700686 136.832744 \r\n",
       "L 135.645077 136.857332 \r\n",
       "L 136.589467 136.265354 \r\n",
       "L 137.533858 135.06273 \r\n",
       "L 138.478249 133.261475 \r\n",
       "L 139.422638 130.879586 \r\n",
       "L 140.367029 127.940863 \r\n",
       "L 141.31142 124.474667 \r\n",
       "L 143.200202 116.103316 \r\n",
       "L 145.088983 106.099274 \r\n",
       "L 146.977765 94.86137 \r\n",
       "L 150.755327 70.507386 \r\n",
       "L 153.5885 52.511172 \r\n",
       "L 155.477281 41.543869 \r\n",
       "L 157.366063 31.916318 \r\n",
       "L 159.254844 24.012348 \r\n",
       "L 160.199234 20.808225 \r\n",
       "L 161.143625 18.147063 \r\n",
       "L 162.088016 16.055453 \r\n",
       "L 163.032407 14.554296 \r\n",
       "L 163.976798 13.658585 \r\n",
       "L 164.921188 13.377273 \r\n",
       "L 165.865579 13.713171 \r\n",
       "L 166.80997 14.662925 \r\n",
       "L 167.754361 16.217039 \r\n",
       "L 168.698752 18.359991 \r\n",
       "L 169.643141 21.070366 \r\n",
       "L 170.587533 24.321087 \r\n",
       "L 171.531923 28.079665 \r\n",
       "L 173.420705 36.965499 \r\n",
       "L 175.309485 47.373605 \r\n",
       "L 178.142659 64.919831 \r\n",
       "L 183.809002 101.104688 \r\n",
       "L 185.697784 111.723875 \r\n",
       "L 187.586563 120.884951 \r\n",
       "L 188.530956 124.801897 \r\n",
       "L 189.475345 128.222721 \r\n",
       "L 190.419735 131.113262 \r\n",
       "L 191.364125 133.444631 \r\n",
       "L 192.308519 135.193547 \r\n",
       "L 193.252909 136.342513 \r\n",
       "L 194.197299 136.880064 \r\n",
       "L 195.141689 136.800829 \r\n",
       "L 196.086078 136.105594 \r\n",
       "L 197.030473 134.801304 \r\n",
       "L 197.974863 132.900997 \r\n",
       "L 198.919252 130.423664 \r\n",
       "L 199.863647 127.394033 \r\n",
       "L 200.808037 123.842408 \r\n",
       "L 202.696816 115.319949 \r\n",
       "L 204.585596 105.19603 \r\n",
       "L 206.474375 93.874261 \r\n",
       "L 214.973897 40.67711 \r\n",
       "L 216.862677 31.180563 \r\n",
       "L 218.751456 23.436924 \r\n",
       "L 219.695851 20.32199 \r\n",
       "L 220.64024 17.754891 \r\n",
       "L 221.58463 15.761264 \r\n",
       "L 222.529025 14.361019 \r\n",
       "L 223.473414 13.56816 \r\n",
       "L 224.417804 13.390601 \r\n",
       "L 225.362194 13.830121 \r\n",
       "L 226.306584 14.882325 \r\n",
       "L 227.250978 16.536707 \r\n",
       "L 228.195363 18.776712 \r\n",
       "L 229.139758 21.579997 \r\n",
       "L 230.084143 24.918507 \r\n",
       "L 231.972932 33.062898 \r\n",
       "L 233.861711 42.885122 \r\n",
       "L 235.750491 53.993632 \r\n",
       "L 238.583665 72.089742 \r\n",
       "L 238.583665 72.089742 \r\n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"line2d_22\">\r\n",
       "    <path clip-path=\"url(#pb28d4a707e)\" d=\"M 61.03821 136.922727 \r\n",
       "L 61.982605 136.614116 \r\n",
       "L 62.92699 135.691381 \r\n",
       "L 63.871384 134.163725 \r\n",
       "L 64.815769 132.046436 \r\n",
       "L 65.760164 129.360631 \r\n",
       "L 66.704558 126.133165 \r\n",
       "L 67.648943 122.396326 \r\n",
       "L 69.537732 113.548404 \r\n",
       "L 71.426512 103.169686 \r\n",
       "L 74.259686 85.64905 \r\n",
       "L 79.926024 49.443049 \r\n",
       "L 81.814804 38.796214 \r\n",
       "L 83.703588 29.598653 \r\n",
       "L 84.647978 25.660632 \r\n",
       "L 85.592368 22.217087 \r\n",
       "L 86.536762 19.302418 \r\n",
       "L 87.481152 16.945765 \r\n",
       "L 88.425542 15.17067 \r\n",
       "L 89.369931 13.994863 \r\n",
       "L 90.314321 13.430094 \r\n",
       "L 91.258711 13.482006 \r\n",
       "L 92.203101 14.150079 \r\n",
       "L 93.147491 15.427638 \r\n",
       "L 94.091885 17.301932 \r\n",
       "L 95.036275 19.754209 \r\n",
       "L 95.980665 22.759984 \r\n",
       "L 96.925054 26.289216 \r\n",
       "L 98.813838 34.772149 \r\n",
       "L 100.702618 44.86479 \r\n",
       "L 102.591402 56.164819 \r\n",
       "L 107.313356 86.671137 \r\n",
       "L 110.14653 104.091407 \r\n",
       "L 112.035309 114.356602 \r\n",
       "L 113.924091 123.058754 \r\n",
       "L 114.868481 126.712436 \r\n",
       "L 115.812873 129.850924 \r\n",
       "L 116.757263 132.44285 \r\n",
       "L 117.701655 134.462328 \r\n",
       "L 118.646045 135.889168 \r\n",
       "L 119.590434 136.709122 \r\n",
       "L 120.534827 136.913994 \r\n",
       "L 121.479216 136.501739 \r\n",
       "L 122.423606 135.476476 \r\n",
       "L 123.367998 133.848442 \r\n",
       "L 124.312388 131.633913 \r\n",
       "L 125.25678 128.855009 \r\n",
       "L 126.20117 125.539504 \r\n",
       "L 127.14556 121.720524 \r\n",
       "L 129.034342 112.7294 \r\n",
       "L 130.923123 102.24009 \r\n",
       "L 133.756295 84.624065 \r\n",
       "L 139.422638 48.502247 \r\n",
       "L 141.31142 37.961602 \r\n",
       "L 143.200202 28.903529 \r\n",
       "L 144.144592 25.046028 \r\n",
       "L 145.088983 21.689145 \r\n",
       "L 146.033374 18.866423 \r\n",
       "L 146.977765 16.606064 \r\n",
       "L 147.922155 14.930655 \r\n",
       "L 148.866546 13.856933 \r\n",
       "L 149.810937 13.395631 \r\n",
       "L 150.755327 13.551352 \r\n",
       "L 151.699718 14.322546 \r\n",
       "L 152.644109 15.701502 \r\n",
       "L 153.5885 17.674447 \r\n",
       "L 154.53289 20.221667 \r\n",
       "L 155.477281 23.317709 \r\n",
       "L 156.421672 26.931637 \r\n",
       "L 158.310453 35.56391 \r\n",
       "L 160.199234 45.774341 \r\n",
       "L 163.032407 63.145354 \r\n",
       "L 168.698752 99.456825 \r\n",
       "L 170.587533 110.254678 \r\n",
       "L 172.476313 119.65299 \r\n",
       "L 174.365095 127.277113 \r\n",
       "L 175.309485 130.325742 \r\n",
       "L 176.253877 132.823079 \r\n",
       "L 177.198267 134.744152 \r\n",
       "L 178.142659 136.069783 \r\n",
       "L 179.087048 136.786719 \r\n",
       "L 180.031438 136.8878 \r\n",
       "L 180.97583 136.372013 \r\n",
       "L 181.92022 135.244512 \r\n",
       "L 182.86461 133.516569 \r\n",
       "L 183.809002 131.205436 \r\n",
       "L 184.753392 128.334218 \r\n",
       "L 185.697784 124.93159 \r\n",
       "L 187.586563 116.67311 \r\n",
       "L 189.475345 106.75921 \r\n",
       "L 191.364125 95.585153 \r\n",
       "L 195.141689 71.270876 \r\n",
       "L 197.974863 53.224953 \r\n",
       "L 199.863647 42.188561 \r\n",
       "L 201.752426 32.466252 \r\n",
       "L 203.641206 24.445593 \r\n",
       "L 204.585596 21.176326 \r\n",
       "L 205.529986 18.44634 \r\n",
       "L 206.474375 16.282917 \r\n",
       "L 207.41877 14.707664 \r\n",
       "L 208.363159 13.736337 \r\n",
       "L 209.307549 13.378628 \r\n",
       "L 210.251939 13.638114 \r\n",
       "L 211.196329 14.512204 \r\n",
       "L 212.140723 15.992171 \r\n",
       "L 213.085113 18.063214 \r\n",
       "L 214.029503 20.704645 \r\n",
       "L 214.973897 23.890088 \r\n",
       "L 215.918287 27.587685 \r\n",
       "L 217.807067 36.366853 \r\n",
       "L 219.695851 46.692196 \r\n",
       "L 222.529025 64.165915 \r\n",
       "L 228.195363 100.408229 \r\n",
       "L 230.084143 111.104316 \r\n",
       "L 231.972932 120.367047 \r\n",
       "L 232.917317 124.342794 \r\n",
       "L 233.861711 127.827058 \r\n",
       "L 234.806097 130.78496 \r\n",
       "L 235.750491 133.186996 \r\n",
       "L 236.694885 135.009139 \r\n",
       "L 237.63927 136.233174 \r\n",
       "L 238.583665 136.846894 \r\n",
       "L 238.583665 136.846894 \r\n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_3\">\r\n",
       "    <path d=\"M 52.160938 143.1 \r\n",
       "L 52.160938 7.2 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_4\">\r\n",
       "    <path d=\"M 247.460938 143.1 \r\n",
       "L 247.460938 7.2 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_5\">\r\n",
       "    <path d=\"M 52.160937 143.1 \r\n",
       "L 247.460938 143.1 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_6\">\r\n",
       "    <path d=\"M 52.160937 7.2 \r\n",
       "L 247.460938 7.2 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"legend_1\">\r\n",
       "    <g id=\"patch_7\">\r\n",
       "     <path d=\"M 147.553125 91.328125 \r\n",
       "L 240.460938 91.328125 \r\n",
       "Q 242.460938 91.328125 242.460938 89.328125 \r\n",
       "L 242.460938 60.971875 \r\n",
       "Q 242.460938 58.971875 240.460938 58.971875 \r\n",
       "L 147.553125 58.971875 \r\n",
       "Q 145.553125 58.971875 145.553125 60.971875 \r\n",
       "L 145.553125 89.328125 \r\n",
       "Q 145.553125 91.328125 147.553125 91.328125 \r\n",
       "z\r\n",
       "\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_23\">\r\n",
       "     <path d=\"M 149.553125 67.070312 \r\n",
       "L 169.553125 67.070312 \r\n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_24\"/>\r\n",
       "    <g id=\"text_13\">\r\n",
       "     <!-- f(x) -->\r\n",
       "     <g transform=\"translate(177.553125 70.570312)scale(0.1 -0.1)\">\r\n",
       "      <use xlink:href=\"#DejaVuSans-102\"/>\r\n",
       "      <use x=\"35.205078\" xlink:href=\"#DejaVuSans-40\"/>\r\n",
       "      <use x=\"74.21875\" xlink:href=\"#DejaVuSans-120\"/>\r\n",
       "      <use x=\"133.398438\" xlink:href=\"#DejaVuSans-41\"/>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_25\">\r\n",
       "     <path d=\"M 149.553125 81.748437 \r\n",
       "L 169.553125 81.748437 \r\n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_26\"/>\r\n",
       "    <g id=\"text_14\">\r\n",
       "     <!-- Tangent line -->\r\n",
       "     <g transform=\"translate(177.553125 85.248437)scale(0.1 -0.1)\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M -0.296875 72.90625 \r\n",
       "L 61.375 72.90625 \r\n",
       "L 61.375 64.59375 \r\n",
       "L 35.5 64.59375 \r\n",
       "L 35.5 0 \r\n",
       "L 25.59375 0 \r\n",
       "L 25.59375 64.59375 \r\n",
       "L -0.296875 64.59375 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-84\"/>\r\n",
       "       <path d=\"M 34.28125 27.484375 \r\n",
       "Q 23.390625 27.484375 19.1875 25 \r\n",
       "Q 14.984375 22.515625 14.984375 16.5 \r\n",
       "Q 14.984375 11.71875 18.140625 8.90625 \r\n",
       "Q 21.296875 6.109375 26.703125 6.109375 \r\n",
       "Q 34.1875 6.109375 38.703125 11.40625 \r\n",
       "Q 43.21875 16.703125 43.21875 25.484375 \r\n",
       "L 43.21875 27.484375 \r\n",
       "z\r\n",
       "M 52.203125 31.203125 \r\n",
       "L 52.203125 0 \r\n",
       "L 43.21875 0 \r\n",
       "L 43.21875 8.296875 \r\n",
       "Q 40.140625 3.328125 35.546875 0.953125 \r\n",
       "Q 30.953125 -1.421875 24.3125 -1.421875 \r\n",
       "Q 15.921875 -1.421875 10.953125 3.296875 \r\n",
       "Q 6 8.015625 6 15.921875 \r\n",
       "Q 6 25.140625 12.171875 29.828125 \r\n",
       "Q 18.359375 34.515625 30.609375 34.515625 \r\n",
       "L 43.21875 34.515625 \r\n",
       "L 43.21875 35.40625 \r\n",
       "Q 43.21875 41.609375 39.140625 45 \r\n",
       "Q 35.0625 48.390625 27.6875 48.390625 \r\n",
       "Q 23 48.390625 18.546875 47.265625 \r\n",
       "Q 14.109375 46.140625 10.015625 43.890625 \r\n",
       "L 10.015625 52.203125 \r\n",
       "Q 14.9375 54.109375 19.578125 55.046875 \r\n",
       "Q 24.21875 56 28.609375 56 \r\n",
       "Q 40.484375 56 46.34375 49.84375 \r\n",
       "Q 52.203125 43.703125 52.203125 31.203125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-97\"/>\r\n",
       "       <path d=\"M 54.890625 33.015625 \r\n",
       "L 54.890625 0 \r\n",
       "L 45.90625 0 \r\n",
       "L 45.90625 32.71875 \r\n",
       "Q 45.90625 40.484375 42.875 44.328125 \r\n",
       "Q 39.84375 48.1875 33.796875 48.1875 \r\n",
       "Q 26.515625 48.1875 22.3125 43.546875 \r\n",
       "Q 18.109375 38.921875 18.109375 30.90625 \r\n",
       "L 18.109375 0 \r\n",
       "L 9.078125 0 \r\n",
       "L 9.078125 54.6875 \r\n",
       "L 18.109375 54.6875 \r\n",
       "L 18.109375 46.1875 \r\n",
       "Q 21.34375 51.125 25.703125 53.5625 \r\n",
       "Q 30.078125 56 35.796875 56 \r\n",
       "Q 45.21875 56 50.046875 50.171875 \r\n",
       "Q 54.890625 44.34375 54.890625 33.015625 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-110\"/>\r\n",
       "       <path d=\"M 45.40625 27.984375 \r\n",
       "Q 45.40625 37.75 41.375 43.109375 \r\n",
       "Q 37.359375 48.484375 30.078125 48.484375 \r\n",
       "Q 22.859375 48.484375 18.828125 43.109375 \r\n",
       "Q 14.796875 37.75 14.796875 27.984375 \r\n",
       "Q 14.796875 18.265625 18.828125 12.890625 \r\n",
       "Q 22.859375 7.515625 30.078125 7.515625 \r\n",
       "Q 37.359375 7.515625 41.375 12.890625 \r\n",
       "Q 45.40625 18.265625 45.40625 27.984375 \r\n",
       "z\r\n",
       "M 54.390625 6.78125 \r\n",
       "Q 54.390625 -7.171875 48.1875 -13.984375 \r\n",
       "Q 42 -20.796875 29.203125 -20.796875 \r\n",
       "Q 24.46875 -20.796875 20.265625 -20.09375 \r\n",
       "Q 16.0625 -19.390625 12.109375 -17.921875 \r\n",
       "L 12.109375 -9.1875 \r\n",
       "Q 16.0625 -11.328125 19.921875 -12.34375 \r\n",
       "Q 23.78125 -13.375 27.78125 -13.375 \r\n",
       "Q 36.625 -13.375 41.015625 -8.765625 \r\n",
       "Q 45.40625 -4.15625 45.40625 5.171875 \r\n",
       "L 45.40625 9.625 \r\n",
       "Q 42.625 4.78125 38.28125 2.390625 \r\n",
       "Q 33.9375 0 27.875 0 \r\n",
       "Q 17.828125 0 11.671875 7.65625 \r\n",
       "Q 5.515625 15.328125 5.515625 27.984375 \r\n",
       "Q 5.515625 40.671875 11.671875 48.328125 \r\n",
       "Q 17.828125 56 27.875 56 \r\n",
       "Q 33.9375 56 38.28125 53.609375 \r\n",
       "Q 42.625 51.21875 45.40625 46.390625 \r\n",
       "L 45.40625 54.6875 \r\n",
       "L 54.390625 54.6875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-103\"/>\r\n",
       "       <path d=\"M 56.203125 29.59375 \r\n",
       "L 56.203125 25.203125 \r\n",
       "L 14.890625 25.203125 \r\n",
       "Q 15.484375 15.921875 20.484375 11.0625 \r\n",
       "Q 25.484375 6.203125 34.421875 6.203125 \r\n",
       "Q 39.59375 6.203125 44.453125 7.46875 \r\n",
       "Q 49.3125 8.734375 54.109375 11.28125 \r\n",
       "L 54.109375 2.78125 \r\n",
       "Q 49.265625 0.734375 44.1875 -0.34375 \r\n",
       "Q 39.109375 -1.421875 33.890625 -1.421875 \r\n",
       "Q 20.796875 -1.421875 13.15625 6.1875 \r\n",
       "Q 5.515625 13.8125 5.515625 26.8125 \r\n",
       "Q 5.515625 40.234375 12.765625 48.109375 \r\n",
       "Q 20.015625 56 32.328125 56 \r\n",
       "Q 43.359375 56 49.78125 48.890625 \r\n",
       "Q 56.203125 41.796875 56.203125 29.59375 \r\n",
       "z\r\n",
       "M 47.21875 32.234375 \r\n",
       "Q 47.125 39.59375 43.09375 43.984375 \r\n",
       "Q 39.0625 48.390625 32.421875 48.390625 \r\n",
       "Q 24.90625 48.390625 20.390625 44.140625 \r\n",
       "Q 15.875 39.890625 15.1875 32.171875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-101\"/>\r\n",
       "       <path d=\"M 18.3125 70.21875 \r\n",
       "L 18.3125 54.6875 \r\n",
       "L 36.8125 54.6875 \r\n",
       "L 36.8125 47.703125 \r\n",
       "L 18.3125 47.703125 \r\n",
       "L 18.3125 18.015625 \r\n",
       "Q 18.3125 11.328125 20.140625 9.421875 \r\n",
       "Q 21.96875 7.515625 27.59375 7.515625 \r\n",
       "L 36.8125 7.515625 \r\n",
       "L 36.8125 0 \r\n",
       "L 27.59375 0 \r\n",
       "Q 17.1875 0 13.234375 3.875 \r\n",
       "Q 9.28125 7.765625 9.28125 18.015625 \r\n",
       "L 9.28125 47.703125 \r\n",
       "L 2.6875 47.703125 \r\n",
       "L 2.6875 54.6875 \r\n",
       "L 9.28125 54.6875 \r\n",
       "L 9.28125 70.21875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-116\"/>\r\n",
       "       <path id=\"DejaVuSans-32\"/>\r\n",
       "       <path d=\"M 9.421875 75.984375 \r\n",
       "L 18.40625 75.984375 \r\n",
       "L 18.40625 0 \r\n",
       "L 9.421875 0 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-108\"/>\r\n",
       "       <path d=\"M 9.421875 54.6875 \r\n",
       "L 18.40625 54.6875 \r\n",
       "L 18.40625 0 \r\n",
       "L 9.421875 0 \r\n",
       "z\r\n",
       "M 9.421875 75.984375 \r\n",
       "L 18.40625 75.984375 \r\n",
       "L 18.40625 64.59375 \r\n",
       "L 9.421875 64.59375 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-105\"/>\r\n",
       "      </defs>\r\n",
       "      <use xlink:href=\"#DejaVuSans-84\"/>\r\n",
       "      <use x=\"44.583984\" xlink:href=\"#DejaVuSans-97\"/>\r\n",
       "      <use x=\"105.863281\" xlink:href=\"#DejaVuSans-110\"/>\r\n",
       "      <use x=\"169.242188\" xlink:href=\"#DejaVuSans-103\"/>\r\n",
       "      <use x=\"232.71875\" xlink:href=\"#DejaVuSans-101\"/>\r\n",
       "      <use x=\"294.242188\" xlink:href=\"#DejaVuSans-110\"/>\r\n",
       "      <use x=\"357.621094\" xlink:href=\"#DejaVuSans-116\"/>\r\n",
       "      <use x=\"396.830078\" xlink:href=\"#DejaVuSans-32\"/>\r\n",
       "      <use x=\"428.617188\" xlink:href=\"#DejaVuSans-108\"/>\r\n",
       "      <use x=\"456.400391\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      <use x=\"484.183594\" xlink:href=\"#DejaVuSans-110\"/>\r\n",
       "      <use x=\"547.5625\" xlink:href=\"#DejaVuSans-101\"/>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "   </g>\r\n",
       "  </g>\r\n",
       " </g>\r\n",
       " <defs>\r\n",
       "  <clipPath id=\"pb28d4a707e\">\r\n",
       "   <rect height=\"135.9\" width=\"195.3\" x=\"52.160938\" y=\"7.2\"/>\r\n",
       "  </clipPath>\r\n",
       " </defs>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from IPython import display\n",
    "from d2l import torch as d2l\n",
    "x = torch.arange(-3*np.pi,3*np.pi,0.1, requires_grad=True)\n",
    "x1 = x.detach()\n",
    "Y = torch.sin(x)\n",
    "Y1 = Y.detach()\n",
    "Y.sum().backward()\n",
    "DF = x.grad\n",
    "d2l.plot(x1.numpy(), [Y1,DF], 'x', 'f(x)',legend=['f(x)', 'Tangent line'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n",
       "<svg height=\"248.518125pt\" version=\"1.1\" viewBox=\"0 0 386.845313 248.518125\" width=\"386.845313pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       " <metadata>\r\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n",
       "   <cc:Work>\r\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n",
       "    <dc:date>2021-06-25T14:41:17.079423</dc:date>\r\n",
       "    <dc:format>image/svg+xml</dc:format>\r\n",
       "    <dc:creator>\r\n",
       "     <cc:Agent>\r\n",
       "      <dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>\r\n",
       "     </cc:Agent>\r\n",
       "    </dc:creator>\r\n",
       "   </cc:Work>\r\n",
       "  </rdf:RDF>\r\n",
       " </metadata>\r\n",
       " <defs>\r\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n",
       " </defs>\r\n",
       " <g id=\"figure_1\">\r\n",
       "  <g id=\"patch_1\">\r\n",
       "   <path d=\"M 0 248.518125 \r\n",
       "L 386.845313 248.518125 \r\n",
       "L 386.845313 0 \r\n",
       "L 0 0 \r\n",
       "z\r\n",
       "\" style=\"fill:none;\"/>\r\n",
       "  </g>\r\n",
       "  <g id=\"axes_1\">\r\n",
       "   <g id=\"patch_2\">\r\n",
       "    <path d=\"M 44.845313 224.64 \r\n",
       "L 379.645313 224.64 \r\n",
       "L 379.645313 7.2 \r\n",
       "L 44.845313 7.2 \r\n",
       "z\r\n",
       "\" style=\"fill:#ffffff;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"matplotlib.axis_1\">\r\n",
       "    <g id=\"xtick_1\">\r\n",
       "     <g id=\"line2d_1\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 0 0 \r\n",
       "L 0 3.5 \r\n",
       "\" id=\"m5c03971b05\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n",
       "      </defs>\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"60.063494\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_1\">\r\n",
       "      <!-- -3\\pi -->\r\n",
       "      <g transform=\"translate(48.830682 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 4.890625 31.390625 \r\n",
       "L 31.203125 31.390625 \r\n",
       "L 31.203125 23.390625 \r\n",
       "L 4.890625 23.390625 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-45\"/>\r\n",
       "        <path d=\"M 40.578125 39.3125 \r\n",
       "Q 47.65625 37.796875 51.625 33 \r\n",
       "Q 55.609375 28.21875 55.609375 21.1875 \r\n",
       "Q 55.609375 10.40625 48.1875 4.484375 \r\n",
       "Q 40.765625 -1.421875 27.09375 -1.421875 \r\n",
       "Q 22.515625 -1.421875 17.65625 -0.515625 \r\n",
       "Q 12.796875 0.390625 7.625 2.203125 \r\n",
       "L 7.625 11.71875 \r\n",
       "Q 11.71875 9.328125 16.59375 8.109375 \r\n",
       "Q 21.484375 6.890625 26.8125 6.890625 \r\n",
       "Q 36.078125 6.890625 40.9375 10.546875 \r\n",
       "Q 45.796875 14.203125 45.796875 21.1875 \r\n",
       "Q 45.796875 27.640625 41.28125 31.265625 \r\n",
       "Q 36.765625 34.90625 28.71875 34.90625 \r\n",
       "L 20.21875 34.90625 \r\n",
       "L 20.21875 43.015625 \r\n",
       "L 29.109375 43.015625 \r\n",
       "Q 36.375 43.015625 40.234375 45.921875 \r\n",
       "Q 44.09375 48.828125 44.09375 54.296875 \r\n",
       "Q 44.09375 59.90625 40.109375 62.90625 \r\n",
       "Q 36.140625 65.921875 28.71875 65.921875 \r\n",
       "Q 24.65625 65.921875 20.015625 65.03125 \r\n",
       "Q 15.375 64.15625 9.8125 62.3125 \r\n",
       "L 9.8125 71.09375 \r\n",
       "Q 15.4375 72.65625 20.34375 73.4375 \r\n",
       "Q 25.25 74.21875 29.59375 74.21875 \r\n",
       "Q 40.828125 74.21875 47.359375 69.109375 \r\n",
       "Q 53.90625 64.015625 53.90625 55.328125 \r\n",
       "Q 53.90625 49.265625 50.4375 45.09375 \r\n",
       "Q 46.96875 40.921875 40.578125 39.3125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-51\"/>\r\n",
       "        <path d=\"M 8.296875 72.90625 \r\n",
       "L 33.6875 -9.28125 \r\n",
       "L 25.390625 -9.28125 \r\n",
       "L 0 72.90625 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-92\"/>\r\n",
       "        <path d=\"M 18.109375 8.203125 \r\n",
       "L 18.109375 -20.796875 \r\n",
       "L 9.078125 -20.796875 \r\n",
       "L 9.078125 54.6875 \r\n",
       "L 18.109375 54.6875 \r\n",
       "L 18.109375 46.390625 \r\n",
       "Q 20.953125 51.265625 25.265625 53.625 \r\n",
       "Q 29.59375 56 35.59375 56 \r\n",
       "Q 45.5625 56 51.78125 48.09375 \r\n",
       "Q 58.015625 40.1875 58.015625 27.296875 \r\n",
       "Q 58.015625 14.40625 51.78125 6.484375 \r\n",
       "Q 45.5625 -1.421875 35.59375 -1.421875 \r\n",
       "Q 29.59375 -1.421875 25.265625 0.953125 \r\n",
       "Q 20.953125 3.328125 18.109375 8.203125 \r\n",
       "z\r\n",
       "M 48.6875 27.296875 \r\n",
       "Q 48.6875 37.203125 44.609375 42.84375 \r\n",
       "Q 40.53125 48.484375 33.40625 48.484375 \r\n",
       "Q 26.265625 48.484375 22.1875 42.84375 \r\n",
       "Q 18.109375 37.203125 18.109375 27.296875 \r\n",
       "Q 18.109375 17.390625 22.1875 11.75 \r\n",
       "Q 26.265625 6.109375 33.40625 6.109375 \r\n",
       "Q 40.53125 6.109375 44.609375 11.75 \r\n",
       "Q 48.6875 17.390625 48.6875 27.296875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-112\"/>\r\n",
       "        <path d=\"M 9.421875 54.6875 \r\n",
       "L 18.40625 54.6875 \r\n",
       "L 18.40625 0 \r\n",
       "L 9.421875 0 \r\n",
       "z\r\n",
       "M 9.421875 75.984375 \r\n",
       "L 18.40625 75.984375 \r\n",
       "L 18.40625 64.59375 \r\n",
       "L 9.421875 64.59375 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-105\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-45\"/>\r\n",
       "       <use x=\"36.083984\" xlink:href=\"#DejaVuSans-51\"/>\r\n",
       "       <use x=\"99.707031\" xlink:href=\"#DejaVuSans-92\"/>\r\n",
       "       <use x=\"133.398438\" xlink:href=\"#DejaVuSans-112\"/>\r\n",
       "       <use x=\"196.875\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_2\">\r\n",
       "     <g id=\"line2d_2\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"110.790767\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_2\">\r\n",
       "      <!-- -2\\pi -->\r\n",
       "      <g transform=\"translate(99.557955 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 19.1875 8.296875 \r\n",
       "L 53.609375 8.296875 \r\n",
       "L 53.609375 0 \r\n",
       "L 7.328125 0 \r\n",
       "L 7.328125 8.296875 \r\n",
       "Q 12.9375 14.109375 22.625 23.890625 \r\n",
       "Q 32.328125 33.6875 34.8125 36.53125 \r\n",
       "Q 39.546875 41.84375 41.421875 45.53125 \r\n",
       "Q 43.3125 49.21875 43.3125 52.78125 \r\n",
       "Q 43.3125 58.59375 39.234375 62.25 \r\n",
       "Q 35.15625 65.921875 28.609375 65.921875 \r\n",
       "Q 23.96875 65.921875 18.8125 64.3125 \r\n",
       "Q 13.671875 62.703125 7.8125 59.421875 \r\n",
       "L 7.8125 69.390625 \r\n",
       "Q 13.765625 71.78125 18.9375 73 \r\n",
       "Q 24.125 74.21875 28.421875 74.21875 \r\n",
       "Q 39.75 74.21875 46.484375 68.546875 \r\n",
       "Q 53.21875 62.890625 53.21875 53.421875 \r\n",
       "Q 53.21875 48.921875 51.53125 44.890625 \r\n",
       "Q 49.859375 40.875 45.40625 35.40625 \r\n",
       "Q 44.1875 33.984375 37.640625 27.21875 \r\n",
       "Q 31.109375 20.453125 19.1875 8.296875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-50\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-45\"/>\r\n",
       "       <use x=\"36.083984\" xlink:href=\"#DejaVuSans-50\"/>\r\n",
       "       <use x=\"99.707031\" xlink:href=\"#DejaVuSans-92\"/>\r\n",
       "       <use x=\"133.398438\" xlink:href=\"#DejaVuSans-112\"/>\r\n",
       "       <use x=\"196.875\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_3\">\r\n",
       "     <g id=\"line2d_3\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"161.51804\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_3\">\r\n",
       "      <!-- -1\\pi -->\r\n",
       "      <g transform=\"translate(150.285227 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 12.40625 8.296875 \r\n",
       "L 28.515625 8.296875 \r\n",
       "L 28.515625 63.921875 \r\n",
       "L 10.984375 60.40625 \r\n",
       "L 10.984375 69.390625 \r\n",
       "L 28.421875 72.90625 \r\n",
       "L 38.28125 72.90625 \r\n",
       "L 38.28125 8.296875 \r\n",
       "L 54.390625 8.296875 \r\n",
       "L 54.390625 0 \r\n",
       "L 12.40625 0 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-49\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-45\"/>\r\n",
       "       <use x=\"36.083984\" xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"99.707031\" xlink:href=\"#DejaVuSans-92\"/>\r\n",
       "       <use x=\"133.398438\" xlink:href=\"#DejaVuSans-112\"/>\r\n",
       "       <use x=\"196.875\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_4\">\r\n",
       "     <g id=\"line2d_4\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"212.245313\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_4\">\r\n",
       "      <!-- 0 -->\r\n",
       "      <g transform=\"translate(209.064063 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 31.78125 66.40625 \r\n",
       "Q 24.171875 66.40625 20.328125 58.90625 \r\n",
       "Q 16.5 51.421875 16.5 36.375 \r\n",
       "Q 16.5 21.390625 20.328125 13.890625 \r\n",
       "Q 24.171875 6.390625 31.78125 6.390625 \r\n",
       "Q 39.453125 6.390625 43.28125 13.890625 \r\n",
       "Q 47.125 21.390625 47.125 36.375 \r\n",
       "Q 47.125 51.421875 43.28125 58.90625 \r\n",
       "Q 39.453125 66.40625 31.78125 66.40625 \r\n",
       "z\r\n",
       "M 31.78125 74.21875 \r\n",
       "Q 44.046875 74.21875 50.515625 64.515625 \r\n",
       "Q 56.984375 54.828125 56.984375 36.375 \r\n",
       "Q 56.984375 17.96875 50.515625 8.265625 \r\n",
       "Q 44.046875 -1.421875 31.78125 -1.421875 \r\n",
       "Q 19.53125 -1.421875 13.0625 8.265625 \r\n",
       "Q 6.59375 17.96875 6.59375 36.375 \r\n",
       "Q 6.59375 54.828125 13.0625 64.515625 \r\n",
       "Q 19.53125 74.21875 31.78125 74.21875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-48\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_5\">\r\n",
       "     <g id=\"line2d_5\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"262.972585\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_5\">\r\n",
       "      <!-- 1\\pi -->\r\n",
       "      <g transform=\"translate(253.543679 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-92\"/>\r\n",
       "       <use x=\"97.314453\" xlink:href=\"#DejaVuSans-112\"/>\r\n",
       "       <use x=\"160.791016\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_6\">\r\n",
       "     <g id=\"line2d_6\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"313.699858\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_6\">\r\n",
       "      <!-- 2\\pi -->\r\n",
       "      <g transform=\"translate(304.270952 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-50\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-92\"/>\r\n",
       "       <use x=\"97.314453\" xlink:href=\"#DejaVuSans-112\"/>\r\n",
       "       <use x=\"160.791016\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"xtick_7\">\r\n",
       "     <g id=\"line2d_7\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"364.427131\" xlink:href=\"#m5c03971b05\" y=\"224.64\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_7\">\r\n",
       "      <!-- 3\\pi -->\r\n",
       "      <g transform=\"translate(354.998224 239.238437)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-51\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-92\"/>\r\n",
       "       <use x=\"97.314453\" xlink:href=\"#DejaVuSans-112\"/>\r\n",
       "       <use x=\"160.791016\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "   </g>\r\n",
       "   <g id=\"matplotlib.axis_2\">\r\n",
       "    <g id=\"ytick_1\">\r\n",
       "     <g id=\"line2d_8\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 0 0 \r\n",
       "L -3.5 0 \r\n",
       "\" id=\"mcb8aba3ca9\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n",
       "      </defs>\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"214.756364\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_8\">\r\n",
       "      <!-- −1.00 -->\r\n",
       "      <g transform=\"translate(7.2 218.555582)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 10.59375 35.5 \r\n",
       "L 73.1875 35.5 \r\n",
       "L 73.1875 27.203125 \r\n",
       "L 10.59375 27.203125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-8722\"/>\r\n",
       "        <path d=\"M 10.6875 12.40625 \r\n",
       "L 21 12.40625 \r\n",
       "L 21 0 \r\n",
       "L 10.6875 0 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-46\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"242.822266\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_2\">\r\n",
       "     <g id=\"line2d_9\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"190.033271\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_9\">\r\n",
       "      <!-- −0.75 -->\r\n",
       "      <g transform=\"translate(7.2 193.83249)scale(0.1 -0.1)\">\r\n",
       "       <defs>\r\n",
       "        <path d=\"M 8.203125 72.90625 \r\n",
       "L 55.078125 72.90625 \r\n",
       "L 55.078125 68.703125 \r\n",
       "L 28.609375 0 \r\n",
       "L 18.3125 0 \r\n",
       "L 43.21875 64.59375 \r\n",
       "L 8.203125 64.59375 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-55\"/>\r\n",
       "        <path d=\"M 10.796875 72.90625 \r\n",
       "L 49.515625 72.90625 \r\n",
       "L 49.515625 64.59375 \r\n",
       "L 19.828125 64.59375 \r\n",
       "L 19.828125 46.734375 \r\n",
       "Q 21.96875 47.46875 24.109375 47.828125 \r\n",
       "Q 26.265625 48.1875 28.421875 48.1875 \r\n",
       "Q 40.625 48.1875 47.75 41.5 \r\n",
       "Q 54.890625 34.8125 54.890625 23.390625 \r\n",
       "Q 54.890625 11.625 47.5625 5.09375 \r\n",
       "Q 40.234375 -1.421875 26.90625 -1.421875 \r\n",
       "Q 22.3125 -1.421875 17.546875 -0.640625 \r\n",
       "Q 12.796875 0.140625 7.71875 1.703125 \r\n",
       "L 7.71875 11.625 \r\n",
       "Q 12.109375 9.234375 16.796875 8.0625 \r\n",
       "Q 21.484375 6.890625 26.703125 6.890625 \r\n",
       "Q 35.15625 6.890625 40.078125 11.328125 \r\n",
       "Q 45.015625 15.765625 45.015625 23.390625 \r\n",
       "Q 45.015625 31 40.078125 35.4375 \r\n",
       "Q 35.15625 39.890625 26.703125 39.890625 \r\n",
       "Q 22.75 39.890625 18.8125 39.015625 \r\n",
       "Q 14.890625 38.140625 10.796875 36.28125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-53\"/>\r\n",
       "       </defs>\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSans-55\"/>\r\n",
       "       <use x=\"242.822266\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_3\">\r\n",
       "     <g id=\"line2d_10\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"165.310179\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_10\">\r\n",
       "      <!-- −0.50 -->\r\n",
       "      <g transform=\"translate(7.2 169.109398)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "       <use x=\"242.822266\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_4\">\r\n",
       "     <g id=\"line2d_11\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"140.587087\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_11\">\r\n",
       "      <!-- −0.25 -->\r\n",
       "      <g transform=\"translate(7.2 144.386305)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSans-50\"/>\r\n",
       "       <use x=\"242.822266\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_5\">\r\n",
       "     <g id=\"line2d_12\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"115.863994\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_12\">\r\n",
       "      <!-- 0.00 -->\r\n",
       "      <g transform=\"translate(15.579688 119.663213)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_6\">\r\n",
       "     <g id=\"line2d_13\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"91.140902\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_13\">\r\n",
       "      <!-- 0.25 -->\r\n",
       "      <g transform=\"translate(15.579688 94.940121)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-50\"/>\r\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_7\">\r\n",
       "     <g id=\"line2d_14\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"66.41781\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_14\">\r\n",
       "      <!-- 0.50 -->\r\n",
       "      <g transform=\"translate(15.579688 70.217028)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_8\">\r\n",
       "     <g id=\"line2d_15\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"41.694717\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_15\">\r\n",
       "      <!-- 0.75 -->\r\n",
       "      <g transform=\"translate(15.579688 45.493936)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-55\"/>\r\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"ytick_9\">\r\n",
       "     <g id=\"line2d_16\">\r\n",
       "      <g>\r\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"44.845313\" xlink:href=\"#mcb8aba3ca9\" y=\"16.971625\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "     <g id=\"text_16\">\r\n",
       "      <!-- 1.00 -->\r\n",
       "      <g transform=\"translate(15.579688 20.770844)scale(0.1 -0.1)\">\r\n",
       "       <use xlink:href=\"#DejaVuSans-49\"/>\r\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\r\n",
       "      </g>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "   </g>\r\n",
       "   <g id=\"line2d_17\">\r\n",
       "    <path clip-path=\"url(#p6d5e88e968)\" d=\"M 60.063494 115.863994 \r\n",
       "L 63.137874 134.579498 \r\n",
       "L 66.212255 152.618575 \r\n",
       "L 69.286635 169.329246 \r\n",
       "L 72.361015 184.107543 \r\n",
       "L 75.435395 196.41934 \r\n",
       "L 78.509775 205.819658 \r\n",
       "L 81.584155 211.968743 \r\n",
       "L 84.658536 214.644352 \r\n",
       "L 87.732916 213.749782 \r\n",
       "L 90.807296 209.317364 \r\n",
       "L 93.881676 201.507298 \r\n",
       "L 96.956056 190.60186 \r\n",
       "L 100.030436 176.995201 \r\n",
       "L 103.104817 161.179101 \r\n",
       "L 106.179197 143.725194 \r\n",
       "L 109.253577 125.264312 \r\n",
       "L 112.327957 106.463677 \r\n",
       "L 115.402337 88.002794 \r\n",
       "L 118.476717 70.548888 \r\n",
       "L 121.551098 54.732787 \r\n",
       "L 124.625478 41.126128 \r\n",
       "L 127.699858 30.22069 \r\n",
       "L 130.774238 22.410624 \r\n",
       "L 133.848618 17.978207 \r\n",
       "L 136.922998 17.083636 \r\n",
       "L 139.997379 19.759246 \r\n",
       "L 143.071759 25.908331 \r\n",
       "L 146.146139 35.308648 \r\n",
       "L 149.220519 47.620446 \r\n",
       "L 152.294899 62.398743 \r\n",
       "L 155.369279 79.109413 \r\n",
       "L 158.44366 97.14849 \r\n",
       "L 161.51804 115.863994 \r\n",
       "L 164.59242 134.579498 \r\n",
       "L 167.6668 152.618575 \r\n",
       "L 170.74118 169.329246 \r\n",
       "L 173.81556 184.107543 \r\n",
       "L 176.889941 196.41934 \r\n",
       "L 179.964321 205.819658 \r\n",
       "L 183.038701 211.968743 \r\n",
       "L 186.113081 214.644352 \r\n",
       "L 189.187461 213.749782 \r\n",
       "L 192.261841 209.317364 \r\n",
       "L 195.336222 201.507298 \r\n",
       "L 198.410602 190.60186 \r\n",
       "L 201.484982 176.995201 \r\n",
       "L 204.559362 161.179101 \r\n",
       "L 207.633742 143.725194 \r\n",
       "L 210.708122 125.264312 \r\n",
       "L 213.782503 106.463677 \r\n",
       "L 216.856883 88.002794 \r\n",
       "L 219.931263 70.548888 \r\n",
       "L 223.005643 54.732787 \r\n",
       "L 226.080023 41.126128 \r\n",
       "L 229.154403 30.22069 \r\n",
       "L 232.228784 22.410624 \r\n",
       "L 235.303164 17.978207 \r\n",
       "L 238.377544 17.083636 \r\n",
       "L 241.451924 19.759246 \r\n",
       "L 244.526304 25.908331 \r\n",
       "L 247.600684 35.308648 \r\n",
       "L 250.675065 47.620446 \r\n",
       "L 253.749445 62.398743 \r\n",
       "L 256.823825 79.109413 \r\n",
       "L 259.898205 97.14849 \r\n",
       "L 262.972585 115.863994 \r\n",
       "L 266.046965 134.579498 \r\n",
       "L 269.121346 152.618575 \r\n",
       "L 272.195726 169.329246 \r\n",
       "L 275.270106 184.107543 \r\n",
       "L 278.344486 196.41934 \r\n",
       "L 281.418866 205.819658 \r\n",
       "L 284.493246 211.968743 \r\n",
       "L 287.567627 214.644352 \r\n",
       "L 290.642007 213.749782 \r\n",
       "L 293.716387 209.317364 \r\n",
       "L 296.790767 201.507298 \r\n",
       "L 299.865147 190.60186 \r\n",
       "L 302.939527 176.995201 \r\n",
       "L 306.013908 161.179101 \r\n",
       "L 309.088288 143.725194 \r\n",
       "L 312.162668 125.264312 \r\n",
       "L 315.237048 106.463677 \r\n",
       "L 318.311428 88.002794 \r\n",
       "L 321.385808 70.548888 \r\n",
       "L 324.460189 54.732787 \r\n",
       "L 327.534569 41.126128 \r\n",
       "L 330.608949 30.22069 \r\n",
       "L 333.683329 22.410624 \r\n",
       "L 336.757709 17.978207 \r\n",
       "L 339.832089 17.083636 \r\n",
       "L 342.90647 19.759246 \r\n",
       "L 345.98085 25.908331 \r\n",
       "L 349.05523 35.308648 \r\n",
       "L 352.12961 47.620446 \r\n",
       "L 355.20399 62.398743 \r\n",
       "L 358.27837 79.109413 \r\n",
       "L 361.352751 97.14849 \r\n",
       "L 364.427131 115.863994 \r\n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"line2d_18\">\r\n",
       "    <path clip-path=\"url(#p6d5e88e968)\" d=\"M 60.063494 214.756364 \r\n",
       "L 63.137874 212.96925 \r\n",
       "L 66.212255 207.672499 \r\n",
       "L 69.286635 199.057549 \r\n",
       "L 72.361015 187.435768 \r\n",
       "L 75.435395 173.227196 \r\n",
       "L 78.509775 156.945369 \r\n",
       "L 81.584155 139.178754 \r\n",
       "L 84.658536 120.569483 \r\n",
       "L 87.732916 101.790143 \r\n",
       "L 90.807296 83.519468 \r\n",
       "L 93.881676 66.41781 \r\n",
       "L 96.956056 51.103265 \r\n",
       "L 100.030436 38.129341 \r\n",
       "L 103.104817 27.964951 \r\n",
       "L 106.179197 20.977461 \r\n",
       "L 109.253577 17.419417 \r\n",
       "L 112.327957 17.419417 \r\n",
       "L 115.402337 20.977461 \r\n",
       "L 118.476717 27.964951 \r\n",
       "L 121.551098 38.129341 \r\n",
       "L 124.625478 51.103265 \r\n",
       "L 127.699858 66.41781 \r\n",
       "L 130.774238 83.519468 \r\n",
       "L 133.848618 101.790143 \r\n",
       "L 136.922998 120.569483 \r\n",
       "L 139.997379 139.178754 \r\n",
       "L 143.071759 156.945369 \r\n",
       "L 146.146139 173.227196 \r\n",
       "L 149.220519 187.435768 \r\n",
       "L 152.294899 199.057549 \r\n",
       "L 155.369279 207.672499 \r\n",
       "L 158.44366 212.96925 \r\n",
       "L 161.51804 214.756364 \r\n",
       "L 164.59242 212.96925 \r\n",
       "L 167.6668 207.672499 \r\n",
       "L 170.74118 199.057549 \r\n",
       "L 173.81556 187.435768 \r\n",
       "L 176.889941 173.227196 \r\n",
       "L 179.964321 156.945369 \r\n",
       "L 183.038701 139.178754 \r\n",
       "L 186.113081 120.569483 \r\n",
       "L 189.187461 101.790143 \r\n",
       "L 192.261841 83.519468 \r\n",
       "L 195.336222 66.41781 \r\n",
       "L 198.410602 51.103265 \r\n",
       "L 201.484982 38.129341 \r\n",
       "L 204.559362 27.964951 \r\n",
       "L 207.633742 20.977461 \r\n",
       "L 210.708122 17.419417 \r\n",
       "L 213.782503 17.419417 \r\n",
       "L 216.856883 20.977461 \r\n",
       "L 219.931263 27.964951 \r\n",
       "L 223.005643 38.129341 \r\n",
       "L 226.080023 51.103265 \r\n",
       "L 229.154403 66.41781 \r\n",
       "L 232.228784 83.519468 \r\n",
       "L 235.303164 101.790143 \r\n",
       "L 238.377544 120.569483 \r\n",
       "L 241.451924 139.178754 \r\n",
       "L 244.526304 156.945369 \r\n",
       "L 247.600684 173.227196 \r\n",
       "L 250.675065 187.435768 \r\n",
       "L 253.749445 199.057549 \r\n",
       "L 256.823825 207.672499 \r\n",
       "L 259.898205 212.96925 \r\n",
       "L 262.972585 214.756364 \r\n",
       "L 266.046965 212.96925 \r\n",
       "L 269.121346 207.672499 \r\n",
       "L 272.195726 199.057549 \r\n",
       "L 275.270106 187.435768 \r\n",
       "L 278.344486 173.227196 \r\n",
       "L 281.418866 156.945369 \r\n",
       "L 284.493246 139.178754 \r\n",
       "L 287.567627 120.569483 \r\n",
       "L 290.642007 101.790143 \r\n",
       "L 293.716387 83.519468 \r\n",
       "L 296.790767 66.41781 \r\n",
       "L 299.865147 51.103265 \r\n",
       "L 302.939527 38.129341 \r\n",
       "L 306.013908 27.964951 \r\n",
       "L 309.088288 20.977461 \r\n",
       "L 312.162668 17.419417 \r\n",
       "L 315.237048 17.419417 \r\n",
       "L 318.311428 20.977461 \r\n",
       "L 321.385808 27.964951 \r\n",
       "L 324.460189 38.129341 \r\n",
       "L 327.534569 51.103265 \r\n",
       "L 330.608949 66.41781 \r\n",
       "L 333.683329 83.519468 \r\n",
       "L 336.757709 101.790143 \r\n",
       "L 339.832089 120.569483 \r\n",
       "L 342.90647 139.178754 \r\n",
       "L 345.98085 156.945369 \r\n",
       "L 349.05523 173.227196 \r\n",
       "L 352.12961 187.435768 \r\n",
       "L 355.20399 199.057549 \r\n",
       "L 358.27837 207.672499 \r\n",
       "L 361.352751 212.96925 \r\n",
       "L 364.427131 214.756364 \r\n",
       "\" style=\"fill:none;stroke:#ff7f0e;stroke-linecap:square;stroke-width:1.5;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_3\">\r\n",
       "    <path d=\"M 44.845313 224.64 \r\n",
       "L 44.845313 7.2 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_4\">\r\n",
       "    <path d=\"M 379.645313 224.64 \r\n",
       "L 379.645313 7.2 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_5\">\r\n",
       "    <path d=\"M 44.845313 224.64 \r\n",
       "L 379.645313 224.64 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"patch_6\">\r\n",
       "    <path d=\"M 44.845313 7.2 \r\n",
       "L 379.645313 7.2 \r\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n",
       "   </g>\r\n",
       "   <g id=\"legend_1\">\r\n",
       "    <g id=\"patch_7\">\r\n",
       "     <path d=\"M 155.161719 46.55625 \r\n",
       "L 273.328906 46.55625 \r\n",
       "Q 275.328906 46.55625 275.328906 44.55625 \r\n",
       "L 275.328906 16.2 \r\n",
       "Q 275.328906 14.2 273.328906 14.2 \r\n",
       "L 155.161719 14.2 \r\n",
       "Q 153.161719 14.2 153.161719 16.2 \r\n",
       "L 153.161719 44.55625 \r\n",
       "Q 153.161719 46.55625 155.161719 46.55625 \r\n",
       "z\r\n",
       "\" style=\"fill:#4c4c4c;opacity:0.5;stroke:#4c4c4c;stroke-linejoin:miter;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"patch_8\">\r\n",
       "     <path d=\"M 153.161719 44.55625 \r\n",
       "L 271.328906 44.55625 \r\n",
       "Q 273.328906 44.55625 273.328906 42.55625 \r\n",
       "L 273.328906 14.2 \r\n",
       "Q 273.328906 12.2 271.328906 12.2 \r\n",
       "L 153.161719 12.2 \r\n",
       "Q 151.161719 12.2 151.161719 14.2 \r\n",
       "L 151.161719 42.55625 \r\n",
       "Q 151.161719 44.55625 153.161719 44.55625 \r\n",
       "z\r\n",
       "\" style=\"fill:#ffffff;stroke:#cccccc;stroke-linejoin:miter;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_19\">\r\n",
       "     <path d=\"M 155.161719 20.298437 \r\n",
       "L 175.161719 20.298437 \r\n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_20\"/>\r\n",
       "    <g id=\"text_17\">\r\n",
       "     <!-- sin(x) -->\r\n",
       "     <g transform=\"translate(183.161719 23.798437)scale(0.1 -0.1)\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 44.28125 53.078125 \r\n",
       "L 44.28125 44.578125 \r\n",
       "Q 40.484375 46.53125 36.375 47.5 \r\n",
       "Q 32.28125 48.484375 27.875 48.484375 \r\n",
       "Q 21.1875 48.484375 17.84375 46.4375 \r\n",
       "Q 14.5 44.390625 14.5 40.28125 \r\n",
       "Q 14.5 37.15625 16.890625 35.375 \r\n",
       "Q 19.28125 33.59375 26.515625 31.984375 \r\n",
       "L 29.59375 31.296875 \r\n",
       "Q 39.15625 29.25 43.1875 25.515625 \r\n",
       "Q 47.21875 21.78125 47.21875 15.09375 \r\n",
       "Q 47.21875 7.46875 41.1875 3.015625 \r\n",
       "Q 35.15625 -1.421875 24.609375 -1.421875 \r\n",
       "Q 20.21875 -1.421875 15.453125 -0.5625 \r\n",
       "Q 10.6875 0.296875 5.421875 2 \r\n",
       "L 5.421875 11.28125 \r\n",
       "Q 10.40625 8.6875 15.234375 7.390625 \r\n",
       "Q 20.0625 6.109375 24.8125 6.109375 \r\n",
       "Q 31.15625 6.109375 34.5625 8.28125 \r\n",
       "Q 37.984375 10.453125 37.984375 14.40625 \r\n",
       "Q 37.984375 18.0625 35.515625 20.015625 \r\n",
       "Q 33.0625 21.96875 24.703125 23.78125 \r\n",
       "L 21.578125 24.515625 \r\n",
       "Q 13.234375 26.265625 9.515625 29.90625 \r\n",
       "Q 5.8125 33.546875 5.8125 39.890625 \r\n",
       "Q 5.8125 47.609375 11.28125 51.796875 \r\n",
       "Q 16.75 56 26.8125 56 \r\n",
       "Q 31.78125 56 36.171875 55.265625 \r\n",
       "Q 40.578125 54.546875 44.28125 53.078125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-115\"/>\r\n",
       "       <path d=\"M 54.890625 33.015625 \r\n",
       "L 54.890625 0 \r\n",
       "L 45.90625 0 \r\n",
       "L 45.90625 32.71875 \r\n",
       "Q 45.90625 40.484375 42.875 44.328125 \r\n",
       "Q 39.84375 48.1875 33.796875 48.1875 \r\n",
       "Q 26.515625 48.1875 22.3125 43.546875 \r\n",
       "Q 18.109375 38.921875 18.109375 30.90625 \r\n",
       "L 18.109375 0 \r\n",
       "L 9.078125 0 \r\n",
       "L 9.078125 54.6875 \r\n",
       "L 18.109375 54.6875 \r\n",
       "L 18.109375 46.1875 \r\n",
       "Q 21.34375 51.125 25.703125 53.5625 \r\n",
       "Q 30.078125 56 35.796875 56 \r\n",
       "Q 45.21875 56 50.046875 50.171875 \r\n",
       "Q 54.890625 44.34375 54.890625 33.015625 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-110\"/>\r\n",
       "       <path d=\"M 31 75.875 \r\n",
       "Q 24.46875 64.65625 21.28125 53.65625 \r\n",
       "Q 18.109375 42.671875 18.109375 31.390625 \r\n",
       "Q 18.109375 20.125 21.3125 9.0625 \r\n",
       "Q 24.515625 -2 31 -13.1875 \r\n",
       "L 23.1875 -13.1875 \r\n",
       "Q 15.875 -1.703125 12.234375 9.375 \r\n",
       "Q 8.59375 20.453125 8.59375 31.390625 \r\n",
       "Q 8.59375 42.28125 12.203125 53.3125 \r\n",
       "Q 15.828125 64.359375 23.1875 75.875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-40\"/>\r\n",
       "       <path d=\"M 54.890625 54.6875 \r\n",
       "L 35.109375 28.078125 \r\n",
       "L 55.90625 0 \r\n",
       "L 45.3125 0 \r\n",
       "L 29.390625 21.484375 \r\n",
       "L 13.484375 0 \r\n",
       "L 2.875 0 \r\n",
       "L 24.125 28.609375 \r\n",
       "L 4.6875 54.6875 \r\n",
       "L 15.28125 54.6875 \r\n",
       "L 29.78125 35.203125 \r\n",
       "L 44.28125 54.6875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-120\"/>\r\n",
       "       <path d=\"M 8.015625 75.875 \r\n",
       "L 15.828125 75.875 \r\n",
       "Q 23.140625 64.359375 26.78125 53.3125 \r\n",
       "Q 30.421875 42.28125 30.421875 31.390625 \r\n",
       "Q 30.421875 20.453125 26.78125 9.375 \r\n",
       "Q 23.140625 -1.703125 15.828125 -13.1875 \r\n",
       "L 8.015625 -13.1875 \r\n",
       "Q 14.5 -2 17.703125 9.0625 \r\n",
       "Q 20.90625 20.125 20.90625 31.390625 \r\n",
       "Q 20.90625 42.671875 17.703125 53.65625 \r\n",
       "Q 14.5 64.65625 8.015625 75.875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-41\"/>\r\n",
       "      </defs>\r\n",
       "      <use xlink:href=\"#DejaVuSans-115\"/>\r\n",
       "      <use x=\"52.099609\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      <use x=\"79.882812\" xlink:href=\"#DejaVuSans-110\"/>\r\n",
       "      <use x=\"143.261719\" xlink:href=\"#DejaVuSans-40\"/>\r\n",
       "      <use x=\"182.275391\" xlink:href=\"#DejaVuSans-120\"/>\r\n",
       "      <use x=\"241.455078\" xlink:href=\"#DejaVuSans-41\"/>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_21\">\r\n",
       "     <path d=\"M 155.161719 34.976562 \r\n",
       "L 175.161719 34.976562 \r\n",
       "\" style=\"fill:none;stroke:#ff7f0e;stroke-linecap:square;stroke-width:1.5;\"/>\r\n",
       "    </g>\r\n",
       "    <g id=\"line2d_22\"/>\r\n",
       "    <g id=\"text_18\">\r\n",
       "     <!-- gradient of sin(x) -->\r\n",
       "     <g transform=\"translate(183.161719 38.476562)scale(0.1 -0.1)\">\r\n",
       "      <defs>\r\n",
       "       <path d=\"M 45.40625 27.984375 \r\n",
       "Q 45.40625 37.75 41.375 43.109375 \r\n",
       "Q 37.359375 48.484375 30.078125 48.484375 \r\n",
       "Q 22.859375 48.484375 18.828125 43.109375 \r\n",
       "Q 14.796875 37.75 14.796875 27.984375 \r\n",
       "Q 14.796875 18.265625 18.828125 12.890625 \r\n",
       "Q 22.859375 7.515625 30.078125 7.515625 \r\n",
       "Q 37.359375 7.515625 41.375 12.890625 \r\n",
       "Q 45.40625 18.265625 45.40625 27.984375 \r\n",
       "z\r\n",
       "M 54.390625 6.78125 \r\n",
       "Q 54.390625 -7.171875 48.1875 -13.984375 \r\n",
       "Q 42 -20.796875 29.203125 -20.796875 \r\n",
       "Q 24.46875 -20.796875 20.265625 -20.09375 \r\n",
       "Q 16.0625 -19.390625 12.109375 -17.921875 \r\n",
       "L 12.109375 -9.1875 \r\n",
       "Q 16.0625 -11.328125 19.921875 -12.34375 \r\n",
       "Q 23.78125 -13.375 27.78125 -13.375 \r\n",
       "Q 36.625 -13.375 41.015625 -8.765625 \r\n",
       "Q 45.40625 -4.15625 45.40625 5.171875 \r\n",
       "L 45.40625 9.625 \r\n",
       "Q 42.625 4.78125 38.28125 2.390625 \r\n",
       "Q 33.9375 0 27.875 0 \r\n",
       "Q 17.828125 0 11.671875 7.65625 \r\n",
       "Q 5.515625 15.328125 5.515625 27.984375 \r\n",
       "Q 5.515625 40.671875 11.671875 48.328125 \r\n",
       "Q 17.828125 56 27.875 56 \r\n",
       "Q 33.9375 56 38.28125 53.609375 \r\n",
       "Q 42.625 51.21875 45.40625 46.390625 \r\n",
       "L 45.40625 54.6875 \r\n",
       "L 54.390625 54.6875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-103\"/>\r\n",
       "       <path d=\"M 41.109375 46.296875 \r\n",
       "Q 39.59375 47.171875 37.8125 47.578125 \r\n",
       "Q 36.03125 48 33.890625 48 \r\n",
       "Q 26.265625 48 22.1875 43.046875 \r\n",
       "Q 18.109375 38.09375 18.109375 28.8125 \r\n",
       "L 18.109375 0 \r\n",
       "L 9.078125 0 \r\n",
       "L 9.078125 54.6875 \r\n",
       "L 18.109375 54.6875 \r\n",
       "L 18.109375 46.1875 \r\n",
       "Q 20.953125 51.171875 25.484375 53.578125 \r\n",
       "Q 30.03125 56 36.53125 56 \r\n",
       "Q 37.453125 56 38.578125 55.875 \r\n",
       "Q 39.703125 55.765625 41.0625 55.515625 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-114\"/>\r\n",
       "       <path d=\"M 34.28125 27.484375 \r\n",
       "Q 23.390625 27.484375 19.1875 25 \r\n",
       "Q 14.984375 22.515625 14.984375 16.5 \r\n",
       "Q 14.984375 11.71875 18.140625 8.90625 \r\n",
       "Q 21.296875 6.109375 26.703125 6.109375 \r\n",
       "Q 34.1875 6.109375 38.703125 11.40625 \r\n",
       "Q 43.21875 16.703125 43.21875 25.484375 \r\n",
       "L 43.21875 27.484375 \r\n",
       "z\r\n",
       "M 52.203125 31.203125 \r\n",
       "L 52.203125 0 \r\n",
       "L 43.21875 0 \r\n",
       "L 43.21875 8.296875 \r\n",
       "Q 40.140625 3.328125 35.546875 0.953125 \r\n",
       "Q 30.953125 -1.421875 24.3125 -1.421875 \r\n",
       "Q 15.921875 -1.421875 10.953125 3.296875 \r\n",
       "Q 6 8.015625 6 15.921875 \r\n",
       "Q 6 25.140625 12.171875 29.828125 \r\n",
       "Q 18.359375 34.515625 30.609375 34.515625 \r\n",
       "L 43.21875 34.515625 \r\n",
       "L 43.21875 35.40625 \r\n",
       "Q 43.21875 41.609375 39.140625 45 \r\n",
       "Q 35.0625 48.390625 27.6875 48.390625 \r\n",
       "Q 23 48.390625 18.546875 47.265625 \r\n",
       "Q 14.109375 46.140625 10.015625 43.890625 \r\n",
       "L 10.015625 52.203125 \r\n",
       "Q 14.9375 54.109375 19.578125 55.046875 \r\n",
       "Q 24.21875 56 28.609375 56 \r\n",
       "Q 40.484375 56 46.34375 49.84375 \r\n",
       "Q 52.203125 43.703125 52.203125 31.203125 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-97\"/>\r\n",
       "       <path d=\"M 45.40625 46.390625 \r\n",
       "L 45.40625 75.984375 \r\n",
       "L 54.390625 75.984375 \r\n",
       "L 54.390625 0 \r\n",
       "L 45.40625 0 \r\n",
       "L 45.40625 8.203125 \r\n",
       "Q 42.578125 3.328125 38.25 0.953125 \r\n",
       "Q 33.9375 -1.421875 27.875 -1.421875 \r\n",
       "Q 17.96875 -1.421875 11.734375 6.484375 \r\n",
       "Q 5.515625 14.40625 5.515625 27.296875 \r\n",
       "Q 5.515625 40.1875 11.734375 48.09375 \r\n",
       "Q 17.96875 56 27.875 56 \r\n",
       "Q 33.9375 56 38.25 53.625 \r\n",
       "Q 42.578125 51.265625 45.40625 46.390625 \r\n",
       "z\r\n",
       "M 14.796875 27.296875 \r\n",
       "Q 14.796875 17.390625 18.875 11.75 \r\n",
       "Q 22.953125 6.109375 30.078125 6.109375 \r\n",
       "Q 37.203125 6.109375 41.296875 11.75 \r\n",
       "Q 45.40625 17.390625 45.40625 27.296875 \r\n",
       "Q 45.40625 37.203125 41.296875 42.84375 \r\n",
       "Q 37.203125 48.484375 30.078125 48.484375 \r\n",
       "Q 22.953125 48.484375 18.875 42.84375 \r\n",
       "Q 14.796875 37.203125 14.796875 27.296875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-100\"/>\r\n",
       "       <path d=\"M 56.203125 29.59375 \r\n",
       "L 56.203125 25.203125 \r\n",
       "L 14.890625 25.203125 \r\n",
       "Q 15.484375 15.921875 20.484375 11.0625 \r\n",
       "Q 25.484375 6.203125 34.421875 6.203125 \r\n",
       "Q 39.59375 6.203125 44.453125 7.46875 \r\n",
       "Q 49.3125 8.734375 54.109375 11.28125 \r\n",
       "L 54.109375 2.78125 \r\n",
       "Q 49.265625 0.734375 44.1875 -0.34375 \r\n",
       "Q 39.109375 -1.421875 33.890625 -1.421875 \r\n",
       "Q 20.796875 -1.421875 13.15625 6.1875 \r\n",
       "Q 5.515625 13.8125 5.515625 26.8125 \r\n",
       "Q 5.515625 40.234375 12.765625 48.109375 \r\n",
       "Q 20.015625 56 32.328125 56 \r\n",
       "Q 43.359375 56 49.78125 48.890625 \r\n",
       "Q 56.203125 41.796875 56.203125 29.59375 \r\n",
       "z\r\n",
       "M 47.21875 32.234375 \r\n",
       "Q 47.125 39.59375 43.09375 43.984375 \r\n",
       "Q 39.0625 48.390625 32.421875 48.390625 \r\n",
       "Q 24.90625 48.390625 20.390625 44.140625 \r\n",
       "Q 15.875 39.890625 15.1875 32.171875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-101\"/>\r\n",
       "       <path d=\"M 18.3125 70.21875 \r\n",
       "L 18.3125 54.6875 \r\n",
       "L 36.8125 54.6875 \r\n",
       "L 36.8125 47.703125 \r\n",
       "L 18.3125 47.703125 \r\n",
       "L 18.3125 18.015625 \r\n",
       "Q 18.3125 11.328125 20.140625 9.421875 \r\n",
       "Q 21.96875 7.515625 27.59375 7.515625 \r\n",
       "L 36.8125 7.515625 \r\n",
       "L 36.8125 0 \r\n",
       "L 27.59375 0 \r\n",
       "Q 17.1875 0 13.234375 3.875 \r\n",
       "Q 9.28125 7.765625 9.28125 18.015625 \r\n",
       "L 9.28125 47.703125 \r\n",
       "L 2.6875 47.703125 \r\n",
       "L 2.6875 54.6875 \r\n",
       "L 9.28125 54.6875 \r\n",
       "L 9.28125 70.21875 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-116\"/>\r\n",
       "       <path id=\"DejaVuSans-32\"/>\r\n",
       "       <path d=\"M 30.609375 48.390625 \r\n",
       "Q 23.390625 48.390625 19.1875 42.75 \r\n",
       "Q 14.984375 37.109375 14.984375 27.296875 \r\n",
       "Q 14.984375 17.484375 19.15625 11.84375 \r\n",
       "Q 23.34375 6.203125 30.609375 6.203125 \r\n",
       "Q 37.796875 6.203125 41.984375 11.859375 \r\n",
       "Q 46.1875 17.53125 46.1875 27.296875 \r\n",
       "Q 46.1875 37.015625 41.984375 42.703125 \r\n",
       "Q 37.796875 48.390625 30.609375 48.390625 \r\n",
       "z\r\n",
       "M 30.609375 56 \r\n",
       "Q 42.328125 56 49.015625 48.375 \r\n",
       "Q 55.71875 40.765625 55.71875 27.296875 \r\n",
       "Q 55.71875 13.875 49.015625 6.21875 \r\n",
       "Q 42.328125 -1.421875 30.609375 -1.421875 \r\n",
       "Q 18.84375 -1.421875 12.171875 6.21875 \r\n",
       "Q 5.515625 13.875 5.515625 27.296875 \r\n",
       "Q 5.515625 40.765625 12.171875 48.375 \r\n",
       "Q 18.84375 56 30.609375 56 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-111\"/>\r\n",
       "       <path d=\"M 37.109375 75.984375 \r\n",
       "L 37.109375 68.5 \r\n",
       "L 28.515625 68.5 \r\n",
       "Q 23.6875 68.5 21.796875 66.546875 \r\n",
       "Q 19.921875 64.59375 19.921875 59.515625 \r\n",
       "L 19.921875 54.6875 \r\n",
       "L 34.71875 54.6875 \r\n",
       "L 34.71875 47.703125 \r\n",
       "L 19.921875 47.703125 \r\n",
       "L 19.921875 0 \r\n",
       "L 10.890625 0 \r\n",
       "L 10.890625 47.703125 \r\n",
       "L 2.296875 47.703125 \r\n",
       "L 2.296875 54.6875 \r\n",
       "L 10.890625 54.6875 \r\n",
       "L 10.890625 58.5 \r\n",
       "Q 10.890625 67.625 15.140625 71.796875 \r\n",
       "Q 19.390625 75.984375 28.609375 75.984375 \r\n",
       "z\r\n",
       "\" id=\"DejaVuSans-102\"/>\r\n",
       "      </defs>\r\n",
       "      <use xlink:href=\"#DejaVuSans-103\"/>\r\n",
       "      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-114\"/>\r\n",
       "      <use x=\"104.589844\" xlink:href=\"#DejaVuSans-97\"/>\r\n",
       "      <use x=\"165.869141\" xlink:href=\"#DejaVuSans-100\"/>\r\n",
       "      <use x=\"229.345703\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      <use x=\"257.128906\" xlink:href=\"#DejaVuSans-101\"/>\r\n",
       "      <use x=\"318.652344\" xlink:href=\"#DejaVuSans-110\"/>\r\n",
       "      <use x=\"382.03125\" xlink:href=\"#DejaVuSans-116\"/>\r\n",
       "      <use x=\"421.240234\" xlink:href=\"#DejaVuSans-32\"/>\r\n",
       "      <use x=\"453.027344\" xlink:href=\"#DejaVuSans-111\"/>\r\n",
       "      <use x=\"514.208984\" xlink:href=\"#DejaVuSans-102\"/>\r\n",
       "      <use x=\"549.414062\" xlink:href=\"#DejaVuSans-32\"/>\r\n",
       "      <use x=\"581.201172\" xlink:href=\"#DejaVuSans-115\"/>\r\n",
       "      <use x=\"633.300781\" xlink:href=\"#DejaVuSans-105\"/>\r\n",
       "      <use x=\"661.083984\" xlink:href=\"#DejaVuSans-110\"/>\r\n",
       "      <use x=\"724.462891\" xlink:href=\"#DejaVuSans-40\"/>\r\n",
       "      <use x=\"763.476562\" xlink:href=\"#DejaVuSans-120\"/>\r\n",
       "      <use x=\"822.65625\" xlink:href=\"#DejaVuSans-41\"/>\r\n",
       "     </g>\r\n",
       "    </g>\r\n",
       "   </g>\r\n",
       "  </g>\r\n",
       " </g>\r\n",
       " <defs>\r\n",
       "  <clipPath id=\"p6d5e88e968\">\r\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"44.845313\" y=\"7.2\"/>\r\n",
       "  </clipPath>\r\n",
       " </defs>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 附上另外一个网友给出的答案\n",
    "%matplotlib inline\n",
    "import matplotlib.pylab as plt\n",
    "from matplotlib.ticker import FuncFormatter, MultipleLocator\n",
    "import numpy as np\n",
    "import torch\n",
    "\n",
    "f,ax=plt.subplots(1)\n",
    "\n",
    "x = np.linspace(-3*np.pi, 3*np.pi, 100)\n",
    "x1= torch.tensor(x, requires_grad=True)\n",
    "y1= torch.sin(x1)\n",
    "y1.sum().backward()\n",
    "\n",
    "ax.plot(x,np.sin(x),label='sin(x)')\n",
    "ax.plot(x,x1.grad,label='gradient of sin(x)')\n",
    "ax.legend(loc='upper center', shadow=True)\n",
    "\n",
    "ax.xaxis.set_major_formatter(FuncFormatter(\n",
    "lambda val,pos: '{:.0g}\\pi'.format(val/np.pi) if val !=0 else '0'\n",
    "))\n",
    "ax.xaxis.set_major_locator(MultipleLocator(base=np.pi))\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
